﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace MSSClient.Model
{
    [DataContract]
    public class ConfigData
    {
        [DataMember]
        public List<Lv1Data> dataList;

        [DataMember]
        public int SourceListPos = 0;

        [DataMember]
        public int upLoadModel;//ftp上传模式 主动模式 被动模式

        [DataMember]
        public int upLoadType = 1;//1-ftp上传，2-应用上传

        [DataMember]
        public bool DetectBarcode;

        [DataMember]
        public long qualityValue = 60;//图片质量参数

        [DataMember]
        public String OcrTag = "y";//是否启用OCR识别发票，y-识别，n-不识别

        [DataMember]
        public bool DetectWhitePaper;

        public ConfigData()
        {
            dataList = new List<Lv1Data>();
            //lv2List = new List<Data>();
            //lv3List = new List<Data>();
        }

        /*
        public class Data
        {
    	
            [DataMember]
            public string id;
            [DataMember]
            public string name;
            [DataMember]
            public string icon;
            [DataMember]
            public bool isChecked;
            [DataMember]
            public bool isExpanded;
            [DataMember]
            public string date;

            private String m_strImageUrl;
            [DataMember]
            public System.String imageUrl
            {
                get { return m_strImageUrl; }
                set { m_strImageUrl = value; }
            }

            private String m_strBarcode = "";
            [DataMember]
            public System.String barcode
            {
                get { return m_strBarcode; }
                set { m_strBarcode = value; }
            }

            public Data()
            {
                isChecked = false;
                isExpanded = false;
                icon = "";
            }

        }
        */

        public class Lv1Data
        {
            [DataMember]
            public List<Lv2Data> dataList;

            [DataMember]
            public string id;
            [DataMember]
            public string name;
            [DataMember]
            public int level;
            public Lv1Data()
            {
                dataList = new List<Lv2Data>();
            }
        }

        public class Lv2Data
        {
            [DataMember]
            public List<Lv3Data> dataList;
            [DataMember]
            public string id;
            [DataMember]
            public string name;
            [DataMember]
            public string imageName;//图像名称
            [DataMember]
            public string imageCode;
            [DataMember]
            public string repImageCode;//子流程单号
            [DataMember]
            public int ChildrenCount;//子数量
            [DataMember]
            public string bizId;
            [DataMember]
            public Boolean InsertTag;
            [DataMember]
            public int level;
            [DataMember]
            public string Type;//类型
            [DataMember]
            public int isBiSaoType = 0;//是否是补单任务单据，1-是，0或者空-不是
            [DataMember]
            public int isFail = 0;//是否上传失败
            [DataMember]
            public int isMerge = 0;//记录 是否是 合并图像的节点，1-是，0或者空-不是
            [DataMember]
            public int isBuSaoTag = 0;//是否补扫，1-是，0或空-不是
            [DataMember]
            public int isNeedScan;//是否需要扫描，1-需要，0或者空-不需要
            [DataMember]
            public int evaResult;//补单方式 1=仅删除，2=补扫，3=仅补纸质，4=删除且补扫，5=删除且仅补纸质，-1=退单
            [DataMember]
            public string Description = "";//评价描述
            [DataMember]
            public string Notation = "";//批注

            public Lv2Data()
            {
                dataList = new List<Lv3Data>();
            }
        }

        public class Lv3Data
        {
            [DataMember]
            public string id;
            [DataMember]
            public string name;
            [DataMember]
            public string ftpUrl;//ftp路径
            [DataMember]
            public string httpUrl;//http路径
            [DataMember]
            public string imageName;//图像名称
            [DataMember]
            public string imageUrl;//图像名称
            [DataMember]
            public string imageCode;
            [DataMember]
            public string repImageCode;//子流程单号
            [DataMember]
            public int ChildrenCount;//子数量
            [DataMember]
            public string bizId;
            [DataMember]
            public int level;
            [DataMember]
            public string Type;//类型
            [DataMember]
            public int isBiSaoType = 0;//是否是补单任务单据，1-是，0或者空-不是
            [DataMember]
            public string UploadRes;//能否上传结果
            [DataMember]
            public Boolean InsertTag;
            [DataMember]
            public int isOCRSuccess;//是否识别出发票信息
            [DataMember]
            public int isMerge = 0;//记录 是否是 合并图像的节点，1-是，0或者空-不是
            [DataMember]
            public int isBuSaoTag = 0;//是否补扫，1-是，0或空-不是
            [DataMember]
            public int isDelete = 0;//补单操作，是否删除,1-删除，0或者空-不删除
            [DataMember]
            public int isIdentifying = 0;//是否标识为发票
            [DataMember]
            public int count = 0;//是否标识为发票
            [DataMember]
            public List<String> nametagList = new List<string>();//标识后缀，如[发票]，[专用发票]，[补]，[删]，[合]等

            /// <summary>
            /// 发票信息
            /// </summary>
            [DataMember]
            public String invoiceType = "";   //发票类型 01,04普通发票 01,01专用发票
            [DataMember]
            public String invoiceCode = "";   //发票代码
            [DataMember]
            public String invoiceNum = "";    //发票号码
            [DataMember]
            public String invoiceDate = "";   //开票日期
            [DataMember]
            public String amount = "";        //不含税金额
            [DataMember]
            public String totalAmount = "";   //含税金额
            [DataMember]
            public String checkCode = "";     //校验码
            [DataMember]
            public String sellerName = "";    //付款方
            [DataMember]
            public String buyerName = "";     //收款方
            [DataMember]
            public String invoiceContent = "";//发票内容
        }
    }
}
